/*
 Navicat Premium Data Transfer

 Source Server         : docker_mysql01
 Source Server Type    : MySQL
 Source Server Version : 50730
 Source Host           : localhost:3306
 Source Schema         : purchase

 Target Server Type    : MySQL
 Target Server Version : 50730
 File Encoding         : 65001

 Date: 29/07/2020 13:54:51
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for daily_report
-- ----------------------------
DROP TABLE IF EXISTS `daily_report`;
CREATE TABLE `daily_report` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `report_date` date NOT NULL COMMENT '日期',
  `type` tinyint(4) NOT NULL COMMENT '1:早,2:中,3:晚',
  `pyone_from` double DEFAULT NULL COMMENT '胚芽#1 接班底数',
  `pyone_to` double DEFAULT NULL COMMENT '胚芽#1 交班底数',
  `pytwo_from` double DEFAULT NULL COMMENT '胚芽#2 接班底数',
  `pytwo_to` double DEFAULT NULL COMMENT '胚芽#2 交班底数',
  `pyone_total` double DEFAULT NULL COMMENT '胚芽#1 合计',
  `pytwo_total` double DEFAULT NULL COMMENT '胚芽#2 合计',
  `py_total` double DEFAULT NULL COMMENT '胚芽 总计',
  `pjpone_from` double DEFAULT NULL COMMENT '喷浆皮 #1 接班底数',
  `pjpone_to` double DEFAULT NULL COMMENT '喷浆皮 #1 交班底数',
  `pjptwo_from` double DEFAULT NULL COMMENT '喷浆皮 #2 接班底数',
  `pjptwo_to` double DEFAULT NULL COMMENT '喷浆皮 #2 交班底数',
  `pjpone_total` double DEFAULT NULL COMMENT '喷浆皮 #1 合计',
  `pjptwo_total` double DEFAULT NULL COMMENT '喷浆皮 #2 合计',
  `pjp_total` double DEFAULT NULL COMMENT '喷浆皮 总计',
  `ele_wzb_from` double DEFAULT NULL COMMENT '外总表 接班底数',
  `ele_wzb_to` double DEFAULT NULL COMMENT '外总表 交班底数',
  `ele_ndb_from` double DEFAULT NULL COMMENT '内大表 接班底数',
  `ele_ndb_to` double DEFAULT NULL COMMENT '内大表 交班底数',
  `ele_bzj_from` double DEFAULT NULL COMMENT '包装间表 接班底数',
  `ele_bzj_to` double DEFAULT NULL COMMENT '包装间表 交班底数',
  `ele_one_from` double DEFAULT NULL COMMENT '分表#1 接班底数',
  `ele_one_to` double DEFAULT NULL COMMENT '分表#1 交班底数',
  `ele_two_from` double DEFAULT NULL COMMENT '分表#2 接班底数',
  `ele_two_to` double DEFAULT NULL COMMENT '分表#2 交班底数',
  `ele_wzb_total` double DEFAULT NULL COMMENT '外总表 合计',
  `ele_ndb_total` double DEFAULT NULL COMMENT '内大表 合计',
  `ele_bzj_total` double DEFAULT NULL COMMENT '包装间表 合计',
  `ele_one_total` double DEFAULT NULL COMMENT '分表#1 合计',
  `ele_two_total` double DEFAULT NULL COMMENT '分表#2 合计',
  `ele_total` double DEFAULT NULL COMMENT '电 总计',
  `gas_from` double DEFAULT NULL COMMENT '天然气 接班底数',
  `gas_to` double DEFAULT NULL COMMENT '天然气 交班底数',
  `gas_total` double DEFAULT NULL COMMENT '天然气合计',
  `water_from` double DEFAULT NULL COMMENT '水 接班底数',
  `water_to` double DEFAULT NULL COMMENT '水  交班底数',
  `water_total` double DEFAULT NULL COMMENT '水合计',
  `cake_one_from` double DEFAULT NULL COMMENT '饼#1 接班底数',
  `cake_one_to` double DEFAULT NULL COMMENT '饼#1 交班底数',
  `cake_two_from` double DEFAULT NULL COMMENT '饼#2 接班底数',
  `cake_two_to` double DEFAULT NULL COMMENT '饼#2 交班底数',
  `cake_one_total` double DEFAULT NULL COMMENT '饼#1 合计',
  `cake_two_total` double DEFAULT NULL COMMENT '饼#2 合计',
  `cake_total` double DEFAULT NULL COMMENT '饼 总计',
  `oil_flowmeter_from` double DEFAULT NULL COMMENT '油流量计 接班底数',
  `oil_flowmeter_to` double DEFAULT NULL COMMENT '油流量计 交班底数',
  `oil_tank_num_from` int(11) DEFAULT NULL COMMENT '油罐数 接班底数',
  `oil_tank_num_to` int(11) DEFAULT NULL COMMENT '油罐数 交班底数',
  `oil_flowmeter_total` double DEFAULT NULL COMMENT '油流量计 合计',
  `oil_tank_num_total` int(11) DEFAULT NULL COMMENT '油罐数 合计',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `note` varchar(255) DEFAULT NULL,
  `is_delete` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='每日报表';

-- ----------------------------
-- Records of daily_report
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for outbound_oil
-- ----------------------------
DROP TABLE IF EXISTS `outbound_oil`;
CREATE TABLE `outbound_oil` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `order_date` datetime NOT NULL COMMENT '日期',
  `name` varchar(50) DEFAULT NULL COMMENT '物资名称',
  `customer` varchar(50) DEFAULT NULL COMMENT '客户名称',
  `send_num` double DEFAULT NULL COMMENT '发货数量',
  `arrive_num` double DEFAULT NULL COMMENT '到厂数量',
  `pound_diff` double DEFAULT NULL COMMENT '磅差',
  `price` double DEFAULT NULL COMMENT '单价',
  `total_amount` double DEFAULT NULL COMMENT '金额',
  `has_invoice` tinyint(4) DEFAULT NULL COMMENT '是否开票 0 / 1',
  `car_no` varchar(20) NOT NULL COMMENT '车牌号',
  `freight` double DEFAULT NULL COMMENT '运费',
  `is_settlement` tinyint(4) DEFAULT NULL COMMENT '是否结算0/1',
  `note` varchar(255) DEFAULT NULL,
  `account_record` varchar(255) DEFAULT NULL COMMENT '记账',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `is_delete` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='出库油';

-- ----------------------------
-- Records of outbound_oil
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for purchase_order
-- ----------------------------
DROP TABLE IF EXISTS `purchase_order`;
CREATE TABLE `purchase_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `order_date` date NOT NULL COMMENT '日期',
  `name` varchar(50) NOT NULL COMMENT '物资名称',
  `supplier` varchar(100) NOT NULL COMMENT '供应商',
  `supplier_out_num` double DEFAULT NULL COMMENT '供应商出厂数量',
  `real_in_num` double DEFAULT NULL COMMENT '实际入库数量',
  `pound_diff` double DEFAULT NULL COMMENT '磅差',
  `price` double DEFAULT NULL COMMENT '单价',
  `freight` double DEFAULT NULL COMMENT '运费',
  `total_amount` double DEFAULT NULL COMMENT '总金额',
  `car_no` varchar(20) DEFAULT NULL COMMENT '车牌号',
  `has_invoice` tinyint(4) DEFAULT NULL COMMENT '是否开票',
  `note` varchar(255) DEFAULT NULL,
  `account_record` varchar(255) DEFAULT NULL COMMENT '记账',
  `invoice_flag` tinyint(4) DEFAULT NULL COMMENT '发票情况',
  `create_time` datetime NOT NULL,
  `update_time` datetime NOT NULL,
  `is_delete` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of purchase_order
-- ----------------------------
BEGIN;
INSERT INTO `purchase_order` VALUES (6, '2020-07-27', '玉米胚芽饼', '测试供应商', 202, 200, 2, 15, 200, 3030, '苏A2U550', 1, '测试备注', '记账测试', NULL, '2020-07-28 01:01:21', '2020-07-28 01:01:21', 0);
INSERT INTO `purchase_order` VALUES (7, '2020-07-28', '玉米胚芽', '阜丰生物', 33, 33.26, 0.259999999999998, 3570, 2597, 117810, '蒙E79679', 0, '备注到厂', '暂估10发票入账', NULL, '2020-07-28 15:40:15', '2020-07-28 15:40:15', 0);
INSERT INTO `purchase_order` VALUES (8, '2020-07-28', '玉米胚芽', '宜瑞安', 33, 33.26, 0.259999999999998, 350, 3000, 11550, '黑B10240', 0, '备注33', '暂估10发票入账', NULL, '2020-07-28 15:41:08', '2020-07-28 15:41:08', 0);
COMMIT;

-- ----------------------------
-- Table structure for sale_contract
-- ----------------------------
DROP TABLE IF EXISTS `sale_contract`;
CREATE TABLE `sale_contract` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `order_date` date NOT NULL COMMENT '日期',
  `name` varchar(50) NOT NULL COMMENT '科目',
  `purchaser` varchar(100) DEFAULT NULL COMMENT '采购商',
  `contract_code` varchar(50) DEFAULT NULL COMMENT '合同编号',
  `num` double DEFAULT NULL COMMENT '数量',
  `price` double DEFAULT NULL COMMENT '单价',
  `total_amount` double DEFAULT NULL,
  `salesman` varchar(50) NOT NULL COMMENT '销售人',
  `note` varchar(255) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `is_delete` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='销售合同';

-- ----------------------------
-- Records of sale_contract
-- ----------------------------
BEGIN;
INSERT INTO `sale_contract` VALUES (1, '2020-07-28', 'ceshi', 'ceshi', '67890', 0, 10, 0, 'wwj', '110', '2020-07-28 01:28:20', '2020-07-28 16:11:49', 1);
INSERT INTO `sale_contract` VALUES (2, '2020-07-27', '新泰众客', '', 'wwj01', 10, 100, 1000, '王工', '', '2020-07-28 01:46:40', '2020-07-28 01:46:40', 1);
INSERT INTO `sale_contract` VALUES (3, '2020-06-30', '玉米胚芽饼', 'vgtr', 'btry', 123, 10, 1230, 'brgt', 'btgr', '2020-07-28 01:47:51', '2020-07-28 01:47:51', 0);
INSERT INTO `sale_contract` VALUES (4, '2020-07-27', '玉米胚芽饼', '宿迁益客饲料', '合同wwj02', 20, 1735, 34700, '闫哥', '备注无运费', '2020-07-28 01:51:16', '2020-07-28 01:51:16', 1);
INSERT INTO `sale_contract` VALUES (5, '2020-07-28', '16', '宿迁益客饲料', '合同wwj02', 20, 1735, 34700, '闫哥', '备注无运费', '2020-07-28 01:51:20', '2020-07-28 16:13:42', 1);
INSERT INTO `sale_contract` VALUES (6, '2020-06-30', 'ceshi', 'btyhu', 'byt5', 10, 2, 20, 'by5t', 'y5', '2020-07-28 01:51:30', '2020-07-28 01:51:30', 0);
INSERT INTO `sale_contract` VALUES (7, '2020-07-27', 'ceshi', 'brt', 'bthyn', 10, 12, 120, ',mn', 'nuy', '2020-07-28 01:52:04', '2020-07-28 01:52:04', 1);
INSERT INTO `sale_contract` VALUES (8, '2020-06-30', 'ceshi', 'gt5', 'g56', 12, 1, 12, 'bh5', 'hb5y', '2020-07-28 01:53:34', '2020-07-28 01:53:34', 0);
INSERT INTO `sale_contract` VALUES (9, '2020-06-30', 'ceshi', 'xwe', 'rtghyu', 10, 1, 10, 'vgtry', 'btyhu', '2020-07-28 02:15:45', '2020-07-28 02:15:45', 0);
INSERT INTO `sale_contract` VALUES (10, '2020-07-27', 'ceshi', 'gtr5', 'kijuyhtgre', 10, 10, 100, 'tgey6', 'hnyt6u', '2020-07-28 02:18:18', '2020-07-28 02:18:18', 0);
INSERT INTO `sale_contract` VALUES (11, '2020-07-27', 'ceshi', 'vrt', 'bnymu', 10, 1, 10, 'vtyu', 'ghytui', '2020-07-28 02:25:12', '2020-07-28 02:25:12', 0);
INSERT INTO `sale_contract` VALUES (12, '2020-07-27', 'ceshi', 'qqqqq', 'bgt', 10, 1, 10, 'j6j', '7', '2020-07-28 02:27:41', '2020-07-28 02:27:41', 0);
INSERT INTO `sale_contract` VALUES (13, '2020-07-27', 'vtrbtrbrt', 'fff', 'aaaaaaaaa', 10, 10, 100, 'fff', 'test', '2020-07-28 15:40:46', '2020-07-28 16:15:35', 0);
INSERT INTO `sale_contract` VALUES (14, '2020-07-28', 'ceshi', 'gt5', 'g5y', 10, 12, 120, 'gt4', 'hy5', '2020-07-28 15:54:21', '2020-07-28 15:54:21', 1);
INSERT INTO `sale_contract` VALUES (15, '2020-07-29', '新泰众客', 'cgt', 'vrtg', 10, 10, 100, 'nuyt', '', '2020-07-28 16:27:14', '2020-07-28 16:28:47', 0);
INSERT INTO `sale_contract` VALUES (16, '2020-06-30', '', '', '', NULL, NULL, NULL, '', '', '2020-07-28 16:32:14', '2020-07-28 16:32:14', 0);
INSERT INTO `sale_contract` VALUES (17, '2020-07-29', '', '', '', NULL, NULL, NULL, '', '', '2020-07-28 16:32:30', '2020-07-28 16:32:30', 1);
INSERT INTO `sale_contract` VALUES (18, '2020-07-28', 'ceshi', 'g5yte', 'hyt', 1.5, 20, 30, 'nbty', '', '2020-07-28 16:39:00', '2020-07-28 16:51:58', 0);
COMMIT;

-- ----------------------------
-- Table structure for sale_out_cake
-- ----------------------------
DROP TABLE IF EXISTS `sale_out_cake`;
CREATE TABLE `sale_out_cake` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `order_date` date NOT NULL COMMENT '日期',
  `name` varchar(50) DEFAULT NULL COMMENT '科目',
  `purchaser` varchar(50) DEFAULT NULL COMMENT '采购商',
  `send_num` double DEFAULT NULL COMMENT '出厂数量',
  `arrive_num` double DEFAULT NULL COMMENT '到厂数量',
  `price` double DEFAULT NULL COMMENT '单价',
  `total_amount` double DEFAULT NULL COMMENT '总金额',
  `car_no` varchar(20) DEFAULT NULL COMMENT '车号',
  `has_invoice` tinyint(4) DEFAULT '0' COMMENT '是否开票',
  `note` varchar(255) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `is_delete` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='销售出库饼';

-- ----------------------------
-- Records of sale_out_cake
-- ----------------------------
BEGIN;
INSERT INTO `sale_out_cake` VALUES (1, '2020-07-27', '胚芽饼', '邢台益客', 36.84, 36.598, 1960, 71732.08, '苏NBN119', 0, '', '2020-07-28 02:30:49', '2020-07-28 02:30:49', 0);
INSERT INTO `sale_out_cake` VALUES (2, '2020-07-27', '胚芽饼22', '邢台益客', 36.84, 36.598, 1960, 71732.08, '苏NBN119', 0, '', '2020-07-28 02:32:23', '2020-07-28 02:32:23', 0);
INSERT INTO `sale_out_cake` VALUES (3, '2020-07-27', '胚芽饼33', '河北尚瑞', 31.84, 39, 1860, 72540, '苏NBN119', 1, '备注33', '2020-07-28 02:36:22', '2020-07-28 02:36:22', 0);
INSERT INTO `sale_out_cake` VALUES (4, '2020-07-28', 'ceshi', 'cvbn', 30, 20, 100, 2000, 'saxcdvbn', 1, 'cdsvf', '2020-07-28 17:21:00', '2020-07-28 17:32:31', 1);
INSERT INTO `sale_out_cake` VALUES (5, '2020-07-28', 'ceshi', '采购商', 10, 30, 20, 600, '苏N48479', 1, 'fregthytujiukfregthytujiukfregthytu', '2020-07-28 17:27:41', '2020-07-28 17:47:47', 1);
INSERT INTO `sale_out_cake` VALUES (6, '2020-07-28', '新泰众客', 'vgbyt', 1, 1, 1, 1, 'bnjm', 0, 'cvtbty', '2020-07-28 17:38:39', '2020-07-28 18:08:17', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `pid` bigint(20) DEFAULT NULL COMMENT '父级权限id',
  `name` varchar(100) DEFAULT NULL COMMENT '名称',
  `value` varchar(200) DEFAULT NULL COMMENT '权限值',
  `icon` varchar(500) DEFAULT NULL COMMENT '图标',
  `type` int(1) DEFAULT NULL COMMENT '权限类型：0->目录；1->菜单；2->按钮（接口绑定权限）',
  `uri` varchar(200) DEFAULT NULL COMMENT '前端资源路径',
  `status` int(1) DEFAULT NULL COMMENT '启用状态；0->禁用；1->启用',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `sort` int(11) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台用户权限表';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL COMMENT '名称',
  `description` varchar(500) DEFAULT NULL COMMENT '描述',
  `admin_count` int(11) DEFAULT NULL COMMENT '后台用户数量',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `status` int(1) DEFAULT '1' COMMENT '启用状态：0->禁用；1->启用',
  `sort` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台用户角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL,
  `permission_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台用户角色和权限关系表';

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `icon` varchar(500) DEFAULT NULL COMMENT '头像',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `nick_name` varchar(200) DEFAULT NULL COMMENT '昵称',
  `note` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `status` int(1) DEFAULT '1' COMMENT '帐号启用状态：0->禁用；1->启用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='后台用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, 'test', '$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', NULL, '测试账号', NULL, '2018-09-29 13:55:30', '2018-09-29 13:55:39', 1);
INSERT INTO `sys_user` VALUES (3, 'admin', '$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20190129/170157_yIl3_1767531.jpg', 'admin@163.com', '系统管理员', '系统管理员', '2018-10-08 13:32:47', '2019-03-20 15:38:50', 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_permission`;
CREATE TABLE `sys_user_permission` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `permission_id` bigint(20) DEFAULT NULL,
  `type` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台用户和权限关系表(除角色中定义的权限以外的加减权限)';

-- ----------------------------
-- Records of sys_user_permission
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `role_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台用户和角色关系表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
